All Questions
4 questions
5votes
1answer
8kviews
Merge Two Sorted Lists in JavaScript
The task is taken from LeetCode Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example 1: ...
2votes
1answer
477views
Length of the longest consecutive run of 1s in its binary representation
The task Given an integer n, return the length of the longest consecutive run of 1s in its binary representation. For example, given 156, you should return 3 My function solution 1 Style 1 <...
5votes
2answers
938views
Create a min stack
The task is taken from leetcode Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Removes ...
5votes
1answer
299views
Container with most water
The task is taken from leetcode Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of ...